Click here to see the chart styling
species_styles = {
'Adelie': {'color': 'tomato', 's': 100, 'alpha': 0.5},
'Chinstrap': {'color': 'dodgerblue', 'marker': 'v'},
'Gentoo': {'color': 'darkgray', 'edgecolor':'black'}
}Quarto demo for the DVIZ course
TEST
For documentation, see: Quarto User Guide and Reference.
In the command line:
Use:
quarto preview notebookname.ipynb
to live-preview the document.
Use:
quarto render notebookname.ipynb --to html
to render the html.
execute: should all the cells be executed upon renderingcode-fold: all code shown in folded cellsecho: disable code renderself-contained: all the images are embedded in the htmltoc: enable table of contents; the levels can be further specifiedtheme: one of the Bootswatch themes. A customized css file can also be specified.We can have collapsible code snippets
species_styles = {
'Adelie': {'color': 'tomato', 's': 100, 'alpha': 0.5},
'Chinstrap': {'color': 'dodgerblue', 'marker': 'v'},
'Gentoo': {'color': 'darkgray', 'edgecolor':'black'}
}I can hide some code cells:
And some other code cells I can show:
data_agg = data.groupby(['species','island','sex'])['body_mass_g'].count().rename('count').reset_index()
data_agg2 = data_agg.groupby('species')['count'].sum().reset_index()Below is a simple table:
| species | count | |
|---|---|---|
| 0 | Adelie | 146 |
| 1 | Chinstrap | 68 |
| 2 | Gentoo | 119 |
We can change the width of the cell where the table output is rendered:
| species | island | bill_length_mm | bill_depth_mm | flipper_length_mm | body_mass_g | sex | |
|---|---|---|---|---|---|---|---|
| 0 | Adelie | Torgersen | 39.1 | 18.7 | 181.0 | 3750.0 | Male |
| 1 | Adelie | Torgersen | 39.5 | 17.4 | 186.0 | 3800.0 | Female |
| 2 | Adelie | Torgersen | 40.3 | 18.0 | 195.0 | 3250.0 | Female |
| 3 | Adelie | Torgersen | NaN | NaN | NaN | NaN | NaN |
| 4 | Adelie | Torgersen | 36.7 | 19.3 | 193.0 | 3450.0 | Female |
Both tables can be referenced and are rendered to links: Table 1 and Table 2
Let’s make a plotly chart. This will be Figure 1.
We can have various types of notes:
You can change the callout to:
.callout-note.callout-tip.callout-important.callout-caution.callout-warningWith collapse flag you toggle the collapse behavior. You can switch the icon on and off using the icon flag. You can set these parameters per cell of in front matter globally.
We can write on the margins:
This is sucha a nice seaborn chart with pastel colors
We can also print a table in the main field and insert a chart on the margin:
| species | island | sex | count | |
|---|---|---|---|---|
| 0 | Adelie | Biscoe | Female | 22 |
| 1 | Adelie | Biscoe | Male | 22 |
| 2 | Adelie | Dream | Female | 27 |
| 3 | Adelie | Dream | Male | 28 |
| 4 | Adelie | Torgersen | Female | 24 |
| 5 | Adelie | Torgersen | Male | 23 |
| 6 | Chinstrap | Dream | Female | 34 |
| 7 | Chinstrap | Dream | Male | 34 |
| 8 | Gentoo | Biscoe | Female | 58 |
| 9 | Gentoo | Biscoe | Male | 61 |
I can also add asides. Adding more text for this cell to be longer. More text. More text. More text. More text. More text. More text. More text. More text. More text. More text. More text. More text. More text. More text. More text. More text. More text. More text. More text. More text. More text. More text that has a different color
We can also cite bibliography. Use a reference manager like Zotero or Jabref to generate a .bib file with citations. You can also create the entries by hand - they are following a BibTex format. You can also use a tool like https://www.bibme.org/bibtex to generate an entry in the .bib file following an URL.
Citing the penguins (Allisonhorst 2020)
(TK 2021)
The end.